package com.accp;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class MyTagFor extends BodyTagSupport {
	private int count = 0;
	private String times;
	public int doStartTag() throws JspException {
		count = 0;
		return EVAL_BODY_INCLUDE;
	}
	
	public int doAfterBody() throws JspException {
		count++;
		if(count>Integer.parseInt(times)){
			return SKIP_BODY;
		}
		return EVAL_BODY_AGAIN;
	}

	public String getTimes() {
		return times;
	}

	public void setTimes(String times) {
		this.times = times;
	}
}
